package Day21;

import java.io.*;
import java.net.Socket;

public class Demo01 {
    public static void main(String[] args) throws IOException {
        //客户端
        Socket socket = new Socket("localhost",65535);
        InputStream is = socket.getInputStream();
        BufferedReader br = new BufferedReader(new InputStreamReader(is));
        String text = br.readLine();
        System.out.println("收到消息：" + text);



//        OutputStream os = socket.getOutputStream();
//        PrintStream ps = new PrintStream(os);
//        ps.println("你好");
    }
}
